Ext.regModel('Beachs', {
    fields: ['State', 'Name']
});

Ext.regModel('Tweet', {
    fields: ['id', 'text', 'to_user_id', 'from_user', 'created_at', 'profile_image_url']
});

function generateData(){
	var today = new Date(),
		before = today.add(Date.DAY, -5),
		data = [{
			date: before,
			num: 0,
			wave: 10
		}],
		i, currentDate = before;

	for (i = 1; i < 6; i++) {
		data.push({
			date: (currentDate = currentDate.add(Date.DAY, 1)),
			num: i,
			wave: data[i - 1].wave + ((Math.floor(Math.random() * 2) % 2) ? 0 : 1) * Math.floor(Math.random() * 5)
		});
	}
	return data;
}

waves.GraphStore = new Ext.data.JsonStore({
	fields: ['date', 'num', 'wave'],
	data: generateData()
});


waves.BeachStore = new Ext.data.Store({
    model  : 'Beachs',
    sorters: ['State', 'Name'],

    getGroupString : function(record) {
        return record.get('State');
    },

    data: [
        {State: 'SC', Name: 'Navegantes', 			Hashtag: '#Navegantes'},
        {State: 'SC', Name: 'Barra Velha', 			Hashtag: '#BarraVelha'},
        {State: 'SC', Name: 'Bombinhas', 			Hashtag: '#Bombinhas'},
        {State: 'SC', Name: 'Florian&#243;polis', 		Hashtag: '#Florianopolis'},
        {State: 'SC', Name: 'Balne&#225;rio Cambori&#250;', 	Hashtag: '#BalnearioCamboriu'},
        {State: 'SC', Name: 'Penha', 				Hashtag: '#Penha'},
        {State: 'SC', Name: 'Garopaba', 			Hashtag: '#Garopaba'},
        {State: 'SC', Name: 'Governador Celso Ramos', Hashtag: '#GovernadorCelsoRamos'},
        {State: 'SC', Name: 'Imbituba', 			Hashtag: '#Imbituba'},
        {State: 'SC', Name: 'Itaja&#237;', 				Hashtag: '#Itajai'},
        {State: 'SC', Name: 'Laguna', 				Hashtag: '#Laguna'},
		
        {State: 'PR', Name: 'Ilha do Mel', 			Hashtag: '#IlhadoMel'},
        {State: 'PR', Name: 'Pontal do Paran&#225;', 	Hashtag: '#PontaldoParana'},
        {State: 'PR', Name: 'Guaraque&#231;aba', 		Hashtag: '#Guaraquecaba'},
        {State: 'PR', Name: 'Guaratuba', 			Hashtag: '#Guaratuba'},
        {State: 'PR', Name: 'Matinhos', 			Hashtag: '#Matinhos'},
        {State: 'PR', Name: 'Paranagu&#225;', 			Hashtag: '#Paranagua'},		
    ]
});
